@extends('layouts.tankuang')

@section('content')
        <form name="add_form" id="add_form" action="{{url('admin/bz/addbz')}}" method="post" enctype="multipart/form-data">
            <input type="hidden" name="_token" value="{{ csrf_token() }}">
            <div id="div_print">
                <h2 class="text-center mg_b36 mg_t25" style="font-weight:bold;">添加帮助</h2>

                <table class="table-form table-border w mg-auto">
                    <tbody>
                    <tr>
                       <td class="font-bd">发布时间</td>
                        <td>
                             <input type="text" name="time"  class="easyui-datetimebox easyui-validatebox" data-options="required:true,missingMessage:'发布时间不能为空',validateOnCreate:false,validateOnBlur:true"/>
                        </td>
                        <td class="font-bd">帮助标题</td>
                        <td>
                            <input type="text" class="form-input w easyui-validatebox" value="" name="title" data-options="required:true,missingMessage:'帮助标题不能为空',validateOnCreate:false,validateOnBlur:true">
                        </td>
                        <td class="font-bd">帮助分类</td>
                        <td>
                            <select id="type" name="type" class="w150 input_all easyui-validatebox" style="width: 153px;" data-options="required:true,missingMessage:'分类不能为空',validateOnCreate:false,validateOnBlur:true">
                                <option value="">请选择</option>
                                <option value="1">企业端</option>
                                <option value="2">警员端</option>
                            </select>
                        </td>
                    </tr>

                     <tr>
                        <td class="font-bd">帮助内容</td>
                        <td colspan="5"><textarea class="textarea textarea_min easyui-validatebox" name="content" class="form-input w" data-options="required:true,missingMessage:'帮助内容不能为空',validateOnCreate:false,validateOnBlur:true"></textarea></td>
                    </tr>


                    </tbody>
                </table>

            
                <div class="w wbt mg_t25 pd_b20 text-center">
                    <button id="go" type="button" class="easyui-linkbutton dsp" data-options="iconCls:'icon-save'">确定</button>
                    <button type="button" class="easyui-linkbutton dsp" data-options="iconCls:'icon-no'" onclick="$('#adbg').window('close')">关闭</button>
                </div>
            </div>
        </form>



          <script>
            $('#go').click(function (){
            	if(!$("#add_form").form('validate')){
				return false;
				}
                $.ajax({
                    cache: true,
                    type: "POST",
                    url: "{{url('admin/bz/addbz')}}",
                    data:$('#add_form').serialize(),
                    async: false,
                    success: function(data) {
                        if(data.status == 1){
                            $.messager.alert('信息提示',data.msg,'info');
                            $('#adbg').dialog('close');
                            $('.pagination-load').click();
                        }else {
                            $.messager.alert('信息提示',data.msg,'info');
                        }
                    }
                });
            });
        </script>

       

@stop